<?php
// src/Acme/UserBundle/Entity/User.php

namespace Cadss\TestBundle\Entity;

use FOS\UserBundle\Entity\User as BaseUser;
use Doctrine\ORM\Mapping as ORM;

/**
 * @ORM\Entity
 * @ORM\Table(name="fos_user")
 */
class User extends BaseUser
{
    /**
     * @ORM\Id
     * @ORM\Column(type="integer")
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    protected $id;

    /**
     * @ORM\OneToMany(targetEntity="Document", mappedBy="user")
     **/
    private $document;

    public function __construct()
    {
        parent::__construct();
        // your own logic
    }

    /**
     * Get id
     *
     * @return integer 
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Add document
     * 
     * @param \Cadss\TestBundle\Entity\Document $document
     * @return User
     **/
    public function addDocument(\Cadss\TestBundle\Entity\Document $document){
        $this->document[] = $document;

        return $this;
    }

    /**
     * Remove Document
     *
     * @param \Cadss\TestBundle\Entity\Document $document
     **/
    public function removeDocument(\Cadss\TestBundle\Entity\Document $document){
        $this->document->removeElement($document);
    }

    /**
     * Get document
     *
     * @return \Doctrine\Common\Collections\Collection
     **/
    public function getDocument(){
        return $this->document;
    }
}






































